import cv2

# 读取图像
img = cv2.imread('photo4.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

# 创建ORB对象
orb = cv2.ORB_create()

# 检测关键点并计算描述符
kp, des = orb.detectAndCompute(gray, None)

# 在图像上绘制关键点
img = cv2.drawKeypoints(gray, kp, None, color=(0, 255, 0), flags=0)

# 显示结果
cv2.imshow('ORB Features', img)
cv2.waitKey(0)
cv2.destroyAllWindows()